package media_user_info_service

import (
	"hytx_media/models"
)

type MediaUserInfo struct {
	MediaUserId      int
	Account          string
	Introduce        string
	Avatar           string
	OperatorsName    string
	OperatorsIdNo    string
	OperatorsIdPhoto string
	Address          int
	Email            string
}

// 添加日志
func (m *MediaUserInfo) Add() error {

	mediaUser := map[string]interface{}{
		"media_user_id":      m.MediaUserId,
		"account":            m.Account,
		"introduce":          m.Introduce,
		"avatar":             m.Avatar,
		"operators_name":     m.OperatorsName,
		"operators_id_no":    m.OperatorsIdNo,
		"operators_id_photo": m.OperatorsIdPhoto,
		"address":            m.Address,
		"email":              m.Email,
	}

	if err := models.MediaUserInfoAdd(mediaUser); err != nil {
		return err
	}

	return nil
}
